var B_Cookie = {
    _set: function (e, t, n) {
        var a = new Date;
        a.setTime(a.getTime() + 24 * n * 3600 * 1e3), document.cookie = e + "=" + t + ";expires=" + a.toGMTString() + ";path=/"
    }, _get: function (e) {
        for (var t = document.cookie.split(";"), n = null, a = 0; a < t.length; a++) {
            var r = t[a].split("=");
            if ($.trim(r[0]) == e) {
                n = r[1];
                break
            }
        }
        return n
    }, _del: function (e) {
        B_Cookie._set(e, "", -1)
    }
}, B_Game = {
    _searchEmpty: function (e) {
        var t = '          <div class="b_empty">              <div class="des">                <img src="/img/empty.png" alt="">                <span>没有找到与"' + e + '"相关的游戏</span>                <p>ThinkingGame中能够查询过千款热门的游戏舆情以及在AppStore排名靠前的游戏</p>                <p>如果没有直达你希望查询的游戏，可以向我们提交增加更多游戏的建议</p>                <button onclick="B_Login._openPlan()">申请添加游戏</button>              </div>           </div>';
        return t
    }, _collectCache: [], _getDemoProjectId: function () {
        return 134
    }, _setLast: function (e, t) {
        B_Storage._set(t, e)
    }, _getLast: function (e) {
        return B_Storage._get(e) || B_Game._getDemoProjectId()
    }, _imgUrl: function (e, t) {
        switch (t) {
            case"inner":
                return "http://image.thinkinggame.cn/img/inner_game/0.png";
            case"medium":
                return "http://image.thinkinggame.cn/img/project_medium/" + e + ".png";
            default:
                return "http://image.thinkinggame.cn/img/project/" + e + ".png"
        }
    }, _appClassify: function () {
        return ["", "全游戏", "体育", "动作", "娱乐场", "家庭", "小游戏", "扑克牌", "探险", "教育", "文字", "智力", "桌面", "模拟", "策略", "街机", "角色扮演", "赛车", "音乐", "骰子"]
    }, _typeName: function (e) {
        switch (e) {
            case"S":
                return "手游";
            case"Y":
                return "页游";
            case"D":
                return "端游";
            case"W":
                return "单机 电玩"
        }
        return ""
    }, _classify: function (e) {
        return e.attr("game_type")
    }, _imgSourceUrl: function (e, t) {
        switch (t) {
            case"small":
                return "http://image.thinkinggame.cn/img/source/" + e + "_s.png";
            default:
                return "http://image.thinkinggame.cn/img/source/" + e + ".png"
        }
    }, _getGame: function (e, t, n) {
        var a = B_Login._user;
        if (!a || !a.gas_projects)return "";
        for (var r = a.gas_projects, i = {}, o = 1, s = 0; s < r.length && !(o > t); s++)($.inArray(r[s].project_id, e) > -1 || $.inArray(r[s].project_id + "", e) > -1) && (i[r[s].project_id] = [this._imgUrl(r[s].project_id, n), r[s].project_name, r[s].author, r[s].game_type], o++);
        return i
    }, _dropChoosed: function (e, t, n) {
        var a = '<img src="' + this._imgUrl(e, n) + '">' + t + '<i class="tg-graph tg-triangle-gray-bottom"></i>';
        return a
    }, _dropChoose: function (e, t, n, a) {
        "edit" != n && (e || (e = B_Game._getDemoProjectId()));
        var r = B_Login._user;
        if (!r || !r.gas_projects)return "";
        for (var i = r.gas_projects, o = "", s = '<p class="tg-drop-text-part gameDropCurrent">', c = 0; c < i.length; c++) {
            switch (n) {
                case"select":
                    0 == c && (s += "选择游戏...");
                    break;
                case"edit":
                    e ? i[c].project_id + "" == e + "" && (s += '<img src="' + this._imgUrl(i[c].project_id) + '">' + i[c].project_name) : 0 == c && (s += "选择游戏...");
                    break;
                default:
                    i[c].project_id + "" == e + "" && (s += '<img src="' + this._imgUrl(i[c].project_id) + '">' + i[c].project_name)
            }
            o += '<li id="' + i[c].project_id + '">' + i[c].project_name + "</li>"
        }
        s += '<i class="tg-graph tg-triangle-gray-bottom"></i></p>';
        var u = "            " + s + '            <div class="tg-drop-content gameDropPop">                <div class="gameDropSearch">                    <i class="tg-icon tg-search-icon"></i>                    <input type="text" id="gameSearch">                </div>                <ul><div class="b_none">没有找到！</div>' + o + "</ul>            </div>";
        $(t).html(u), B_Format._arrowOpenClose(t + " .tg-drop-text-part", t + " .gameDropPop"), $(t).find("ul li").each(function () {
            $(this).click(function () {
                var e = $(this).attr("id"), n = $(this).html();
                e && "" != e && ($(t).find(".gameDropCurrent").html(B_Game._dropChoosed(e, n)), $(t).find(".gameDropPop").slideUp("fast"), a && a(e))
            })
        });
        var l = "";
        $(t).find("input").keyup(function () {
            var e = $.trim($(this).val());
            clearTimeout(l), l = setTimeout(function () {
                B_Game._dropSearch(t, e)
            }, 300)
        })
    }, _dropSearch: function (e, t) {
        if (t && "" != t) {
            var n = !1;
            $(e).find("ul li").each(function () {
                $(this).html().toLowerCase().indexOf(t.toLowerCase()) > -1 ? (n = !0, $(this).show()) : $(this).hide()
            }), n ? $(e).find("ul div").hide() : $(e).find("ul div").show()
        } else $(e).find("ul div").hide(), $(e).find("ul li").each(function () {
            $(this).show()
        })
    }, _dropInnerGame: function (e, t, n, a) {
        t = t ? t : 0 == t ? 0 : e[0].game_id;
        var r = "", i = "", o = 0;

        console.log("游戏选项框 e",e);
        console.log("游戏选项框 0",o);

        if (e) {
            o = e.length;
            for (var s = 0; s < o; s++)t + "" != e[s].game_id + "" ? r += '<li id="' + e[s].game_id + '">' + e[s].game_name + "</li>" : i = e[s].game_name
        }
        var c = '<p class="tg-drop-text-part gameDropCurrent">';
        //游戏下拉框
        console.log("游戏选项框",i);

        if ("" == i) {
            t = e[0].game_id, i = e[0].game_name;
            for (var s = 0; s < e.length; s++)t + "" != e[s].game_id + "" && (r += '<li id="' + e[s].game_id + '">' + e[s].game_name + "</li>");
            c += B_Game._dropChoosed(e[0].game_id, e[0].game_name, "inner")
        } else c += B_Game._dropChoosed(t, i, "inner");
        "" != i && "demo" == i && 1 == o && (c += '<a class="tg-main-btn demo-game-btn" onclick="B_Login._openProbation();">接入游戏</a>'), c += "</p>";
        var u = "            " + c + '            <div class="tg-drop-content gameDropPop">                <ul>' + r + "</ul>            </div>";
        $(n).html(u), a && a(t), B_Format._arrowOpenClose(n + " .tg-drop-text-part", n + " .gameDropPop"), $(n).find("ul li").each(function () {
            $(this).click(function () {
                var t = $(this).attr("id"), r = $(this).html();
                "" != t && (B_Game._dropInnerGame(e, t, n, a), $(n).find(".gameDropCurrent").html(B_Game._dropChoosed(t, r, "inner")), $(n).find(".gameDropPop").slideUp("fast"))
            })
        })
    }, _tag: function (e) {
        if (!e)return "";
        var t = B_Login._user;
        if (!t.project_tag_dim)return "";
        for (var n = {}, a = t.project_tag_dim, r = 0; r < a.length; r++)$.inArray(a[r].tag_id, e) > -1 && (n[a[r].tag_id] = a[r].tag_name);
        return n
    }, _source: function (e) {
        e = parseInt(e);
        var t = B_Storage._init("source");
        if (t in B_Login._user)for (var n = 0; n < B_Login._user.gas_source_dim.length; ++n)if (B_Login._user.gas_source_dim[n].source_type == e)return B_Login._user.gas_source_dim[n];
        return null
    }, _getCollect: function (e) {
        return B_User._isDemoUser() ? (B_Game._collectCache = [], void(e && e())) : void B_Port._ajax("collect_all", "get", !0, null, null, null, function (t, n) {
            B_Game._collectCache = t && t.collection_list ? t.collection_list : [], e && e()
        }, function (t, n, a) {
            B_Game._collectCache = [], e && e()
        })
    }, _setCollect: function (e, t, n) {
        return B_User._isDemoUser() ? void B_Login._openLogin() : void setTimeout(function () {
            var a = "", r = "", i = "", o = "";
            n && n.on ? (a = n.on[0], r = n.off[0], i = n.on[1], o = n.off[1]) : (a = n + "On", r = n + "Off"), e = parseInt(e);
            var s = {};
            s.project_id = e, s = B_Common._postData(s), B_Game._checkCollect(e) ? (B_Game._collectCache = B_Common._arrayRemove(B_Game._collectCache, e), B_Port._ajax("collect_cancel", "get", !0, s, function () {
                $("#" + t).removeClass(a).addClass(r), $("#" + t).html(o)
            }, null, function (e, t) {
            }, null)) : (B_Game._collectCache.push(e), B_Port._ajax("collect_set", "get", !0, s, function () {
                $("#" + t).addClass(a).removeClass(r), $("#" + t).html(i)
            }, null, function (e, t) {
            }, null))
        }, 300)
    }, _checkCollect: function (e) {
        return $.inArray(parseInt(e), B_Game._collectCache) > -1
    }
}, B_User = {
    _information: {
        companyArr: ["游戏研发", "渠道", "发行/运营", "外包", "投资", "第三方服务", "广告商", "IP授权方", "游戏媒体", "其他"],
        jobArr: ["公司高管", "游戏制作人", "游戏运营", "市场人员", "商务人员", "游戏策划", "开发工程师", "游戏测试", "美术/UI/动画", "音乐/音效", "行政/人力", "投资", "销售", "客服", "其他"]
    }, _isDemoUser: function () {
        console.log("B_Login is:",B_Login._user)
        return false //!(B_Login._user && B_Login._user.user && "demo" !== B_Login._user.user.nick_name)
    }, _getData: function () {
        var e = B_Login._user;
        return e && e.user ? e.user : ""
    }, _setData: function (e) {
        var t = B_Login._user;
        if (!t || !t.user)return "";
        var n = !1;
        $.each(t.user, function (a, r) {
            var i = $.inArray(a, e.key);
            i > -1 && (n = !0, t.user[a] = e.val[i])
        }), n && B_Storage._set("user", t)
    }, _getNick: function (e) {
        console.log("B_Login",B_Login)
        console.log("34343434343",e);
        console.log("ttttttttt",t);
        var t = {}
        t.nick_name = "admin" //B_Login._user.user;
        if (t && t.nick_name) {
            var n = t.nick_name;
            if (0 == n.indexOf("*"))if (t.mobile)t.mobile.length >= 11 && (n = t.mobile.substr(0, 3) + "*****" + t.mobile.substr(8, 11)); else if (t.email) {
                var a = t.email.split("@")[0], r = t.email.split("@")[1];
                if (a.length > 1) {
                    var i = a[0];
                    switch (e) {
                        case"head":
                            i += "*";
                            break;
                        default:
                            for (var o = 1; o < a.length; ++o)i += "*"
                    }
                    a = i
                }
                n = a + "@" + r
            }
            return n
        }
        return ""
    }
}, B_Captcha = {
    _cache: {timeDiff: 0}, _getVCode: function (e) {
        var t = {mobile_or_email: B_Common._encodeUrl(e)};
        t = $.extend(t, B_CaptchaObj.getValidate()), B_Port._ajax("sms", "post", !0, t, function () {
            B_Captcha._timeout(), B_Captcha._refreshCaptcha()
        }, null, function (e, t) {
            B_Pop._init("msg", {content: "验证码已发送！请注意查收"})
        }, function (e, t, n) {
            B_Pop._init("msg", {content: t})
        })
    }, _timeout: function () {
        $("#bs_sms_send").text("60秒后重发").attr("disabled", !0), B_Captcha._cache.timeDiff = 60, timeGo = setInterval("B_Captcha._timeRun()", 1e3)
    }, _timeRun: function (e) {
        B_Captcha._cache.timeDiff <= 0 ? (clearInterval(timeGo), $("#bs_sms_send").text("获取验证码").attr("disabled", !1)) : (B_Captcha._cache.timeDiff -= 1, $("#bs_sms_send").text(B_Captcha._cache.timeDiff + "秒后重发"))
    }, _getCaptcha: function (e) {
        /*try {
         var t = B_Port._init("captcha");
         $.ajax({
         timeout: 3e4, async: !0, type: "get", url: t, data: null, error: function (e, t, n) {
         B_Pop._init("msg", "验证码生成失败，请刷新页面重试")
         }, success: function (t) {
         t && (window.B_CaptchaObj = new window.Geetest({
         gt: t.gt,
         challenge: t.challenge,
         product: "float",
         offline: !t.success
         }), B_CaptchaObj.appendTo("#" + e))
         }
         })
         } catch (e) {
         return void B_Pop._init("msg", "验证码生成失败，请刷新页面重试")
         }*/
    }, _refreshCaptcha: function () {
        B_CaptchaObj && B_CaptchaObj.refresh()
    }
}, B_Login = {
    _isOpen: !1, _user: {}, _openPlan: function (e) {
        if (B_Pop._init("close"), B_User._isDemoUser())B_Login._openLogin(); else {
            var t = B_Login._user.user;
            t && t.mobile && "" != t.mobile ? (e || (e = ""), B_Pop._init("open", {
                type: 2,
                scroll: !0,
                title: "改进计划",
                width: "720px",
                height: "580px",
                shift: 2,
                content: "plan_s.html?f=1&n=" + e
            }, "")) : B_Login._openBind()
        }
    }, _openLogin: function (e) {
      /*  e || (e = "");
        var t = {
            type: 2,
            scroll: !0,
            title: "欢迎登录",
            width: "700px",
            height: "470px",
            shift: 2,
            content: "login_s.html?from=" + e
        };
        switch (e) {
            case"background":
                t.closeBtn = !1
        }
        B_Pop._init("close"), B_Pop._init("open", t, "")*/
    }, _openSalon: function () {
        var e = {
            type: 2,
            scroll: !0,
            title: "沙龙会议",
            width: "1180px",
            height: "700px",
            shift: 2,
            content: "salon_s.html"
        };
        B_Pop._init("close"), B_Pop._init("open", e, "")
    }, _openApplication: function () {
        var e = {
            type: 2,
            scroll: !0,
            title: "欢迎报名本次活动",
            width: "700px",
            height: "470px",
            shift: 2,
            content: "application_s.html"
        };
        B_Pop._init("close"), B_Pop._init("open", e, "")
    }, _openOpen: function () {
        var e = {type: 2, scroll: !0, title: "申请试用", width: "700px", height: "550px", shift: 2, content: "open_s.html"};
        B_Pop._init("close"), B_Pop._init("open", e, "")
    }, _openProbation: function (e) {
        e || (e = "");
        var t = {
            type: 2,
            title: !1,
            closeBtn: !1,
            scroll: !0,
            width: "980px",
            height: "500px",
            shift: 2,
            content: "probation_s.html?from=" + e
        };
        B_Pop._init("close"), B_Pop._init("open", t, "")
    }, _openBind: function () {
        B_Pop._init("close"), B_Pop._init("open", {
            type: 2,
            scroll: !0,
            title: "绑定手机",
            width: "360px",
            height: "520px",
            shift: 2,
            content: "bind_s.html"
        }, "")
    }, _pre: function () {
        var e = B_Storage._get("login");
        return e || (e = ""), e
    }, _buff: function () {
        return B_Storage._get("user")
    }, _setStatus: function (e) {
        var t = B_Date._getCurrentTime(), n = B_Storage._get("status");
        switch (n || (n = {}), e) {
            case"game":
                n.expire = t + 36e5;
                break;
            case"out":
                n.expire = 0
        }
        B_Storage._set("status", n)
    }, _in: function (e, t, n, a) {
        B_Storage._set("login", e.login_name),
            B_Port._ajax("login", "post", !0, e, t, n, function (e, t) {
            console.log("ajax 成功返回",e,t);

            return B_Login._setStatus("out"),  //设置状态

                B_Login._user = e, a.indexOf("Mobile/") > -1 &&
            B_Cookie._set("MobileLoginInit", 1), a ? B_Jump._go("base", a) : B_Jump._go("reload"), !1
        }, function (e, t, n) {
            return B_Pop._init("msg", {content: t}), !1
        })
    }, _out: function (e) {
        B_Port._ajax("logout", "post", !0, {}, null, null, function (t, n) {
            B_Login._setStatus("out"), e ? B_Jump._go("base", e) : top.window.location.reload()
        }, function (e, t, n) {
            B_Pop._init("msg", {content: t})
        })
    }, _sessionStorage: function (e, t, n) {
        switch (e) {
            case"get":
                try {
                    return sessionStorage.getItem(t)
                } catch (e) {
                    return !1
                }
                break;
            case"set":
                try {
                    return sessionStorage.setItem(t, n), !0
                } catch (e) {
                    return !1
                }
        }
    }, _check: function (e, t) {
        B_Common._visitFromMobile(), B_Login._checkUpdate(e, t)
    }, _checkUpdate: function (e, t) {
        var n = B_Common._browser();
        if (n && n.name && "msie" == n.name.toLowerCase() && n.version && parseInt(n.version) < 9)return void B_Jump._go("base", "nobrowsersupport.html");
        B_Common._visitCount();
        var a = !0, r = B_Storage._get("status");
        if (r && r.expire) {
            var i = B_Date._getDiffUnixTime("", r.expire);
            i > 0 && (a = !1)
        }
        B_Login._user = B_Storage._get("user"), a || (B_Login._user && B_Login._user.article_classify_dim && B_Login._user.article_source_dim && B_Login._user.gas_projects && B_Login._user.gas_source_dim && B_Login._user.project_detail_type_dim && B_Login._user.project_tag_dim ? B_User._isDemoUser() || B_Login._user.user || (a = !0) : a = !0, B_Login._sessionStorage("get", "user") || (a = !0)), a && B_Port._ajax("init", "post", !1, null, null, null, function (t, n) {
            return B_Login._user = t, B_Storage._set("user", t), B_Login._setStatus("game"), B_Login._sessionStorage("set", "user", B_Date._getCurrentTime()), e && e(t), !0
        }, function (e, n, a) {
            return t && t(e, n, a), !1
        })
    }, _backUrl: function (e, t) {
        var n = "CLoginBackUrl";
        switch (e) {
            case"set":
                var a = t ? t : B_Common._lastUrl();
                if (a) {
                    for (var r = !1, i = ["register", "login", "find", "information", "bind"], o = 0; o < i.length; o++)a.indexOf(i[o]) > -1 && (r = !0);
                    a = B_Common._encodeUrl(a), r || B_Cookie._set(n, a)
                }
                break;
            case"get":
                var a = B_Cookie._get(n);
                return a ? (B_Cookie._del(n), a = B_Common._decodeUrl(a)) : B_Jump._getUrl("index");
            case"reg":
                var a = B_Cookie._get(n);
                a || B_Login._backUrl("set")
        }
    }, _loginBackUrl: function () {
        var e = B_Login._backUrl("get");
        return e.toLowerCase().indexOf("_s.html") > -1 && (e = e.toLowerCase().indexOf("assistant") > -1 ? B_Jump._getUrl("yuqin") : e.toLowerCase().indexOf("account") > -1 ? B_Jump._getUrl("account") : e.toLowerCase().indexOf("hotword") > -1 ? B_Jump._getUrl("reci") : e.toLowerCase().indexOf("talkresult") > -1 ? B_Jump._getUrl("chat") : B_Jump._getUrl("index")), e
    }
}, B_Pre = {
    _loading: function (e) {
        return e ? '<div class="b_loading ' + e + '"><img src="/img/loading.gif"></div>' : '<div class="b_loading"><img src="/img/loading.gif"></div>'
    }, _empty: function (e, t) {
        return t ? '<div class="b_empty ' + t + '">' + e + "</div>" : '<div class="b_empty">' + e + "</div>"
    }
}, B_Pop = {
    _init: function (e, t, n, a) {
        switch (e) {
            case"open":
                t.color || (t.color = "#000"), t.shift || (t.shift = 1), t.shade || (t.shade = "0.4"), t.closeBtn || (t.closeBtn = 0 == t.closeBtn ? 0 : 1);
                var r = layer.open({
                    type: t.type,
                    area: [t.width, t.height],
                    title: t.title,
                    scrollbar: t.scroll,
                    closeBtn: t.closeBtn,
                    shade: [t.shade, t.color],
                    moveType: 1,
                    shift: t.shift,
                    content: t.content
                });
                return r;
            case"msg":
                t.icon ? layer.msg(t.content, {icon: t.icon}) : (t.offset || (t.offset = "auto"), layer.msg(t.content, {offset: t.offset}));
                break;
            case"alert":
                t.icon ? layer.alert(t.content, {
                    icon: t.icon,
                    title: t.title,
                    closeBtn: t.closeBtn
                }, n) : layer.alert(t.content, n);
                break;
            case"confirm":
                layer.confirm(t.content, {btn: t.btn, skin: t.skin, title: t.title, closeBtn: t.closeBtn}, n, a);
                break;
            case"load":
                layer.load(t.type, {time: 1e3 * t.time, shade: t.shade});
                break;
            case"close":
                layer.closeAll();
                break;
            case"closeFrame":
                var r = parent.layer.getFrameIndex(window.name);
                parent.layer.close(r);
                break;
            case"checkAlert":
                B_Pop._init("close"), B_Pop._init("alert", t, n);
                break;
            case"tips":
                layer.tips(t.content, t.dom, {tips: [t.type, t.color], time: 3e3})
        }
    }
}, B_Storage = {
    _name: "G_LOCAL_STORAGE", _init: function (e) {
        switch (e) {
            case"last":
                return "LastChosenProjectId";
            case"user":
                return "user";
            case"collect":
                return "collect";
            case"game":
                return "gas_crawler_info_gas_apps";
            case"login":
                return "login_name";
            case"crawler":
                return "gas_crawler_info";
            case"app":
                return "gas_apps";
            case"source":
                return "gas_source_dim";
            case"status":
                return "status";
            case"type":
                return "project_detail_type_dim";
            default:
                return e
        }
    }, _get: function (e) {
        var t = store.get(this._name), n = this._init(e);
        return t && t[n] ? t[n] : ""
    }, _set: function (e, t) {
        var n = store.get(this._name);
        n || (n = {});
        var a = this._init(e);
        n[a] = t, store.set(this._name, n)
    }
}, B_Port = {
    _init: function (e) {
        // var t = B_Common._baseHost() + "rest/";
        var t = "/";

        console.log("ajax B_Common._baseHost()  ,", B_Common._baseHost())
        console.log("ajax 事件e,", e)
        console.log("ajax 事件t,", t);

        switch (e) {
            case"login":
                return t + "login/doLogin";
            case  'init':
                 return t + "login/check";
            case"innerGame":
                return t + "service/innerGame";
            case"innerOperationMenu":
                return t + "service/innerOperationMenu";
            case"playerTag":
                return t + "service/innerAnalysisPlayerTag";
            case"playerCluster":
                return t + "service/innerAnalysisPlayerCluster";
            case"innerOperationEvaluate":
                return t + "service/innerOperationEvaluate";
            case"innerOperationActiveUser":  //活跃玩家
                return t + "service/innerOperationActiveuser";
            case"innerOperationNewUser":
                return t + "service/innerOperationNewuser";
            case"innerOperationRetentionUser":
                return t + "service/innerOperationRetentionuser";
            case"innerOperationPayUser":
                return t + "service/innerOperationPayuser";
            case"innerOperationLostUser":
                return t + "service/innerOperationLostuser";
            case"innerOperationHabitUser":
                return t + "service/innerOperationHabituser";

            /* case"industryGeneral":
             return t + "v1/industry/trends";
             case"industryGameType":
             return t + "v1/industry/gametype";
             case"industryUserProvince":
             return t + "v1/industry/userprovince";
             case"industryTypeDistri":
             return t + "v1/industry/typenum";
             case"industryComplain":
             return t + "v1/industry/complain";
             case"industryAppStore":
             return t + "v1/industry/appstoretype";
             case"industryArticleTopic":
             return t + "v1/industry/article/topic";
             case"industryArticleHotWords":
             return t + "v1/industry/article/hotwords";
             case"login":
             return t + "/login/doLogin";
             case"logout":
             return t + "v1/login/logout";
             case"init":
             return t + "v1/login/check";
             case"hotGame":
             return t + "v1/project/home/hot";
             case"recommendGame":
             return t + "v1/service/outer/reputation/recommend";
             case"itemList":
             return t + "v1/item/";
             case"history":
             return t + "v1/user/project/histroy";
             case"guessLike":
             return t + "v1/project/user/recommend";
             case"collect_all":
             return t + "v1/user/project/collection";
             case"userApplicationFree":
             return t + "v1/service/user/free";
             case"hotWordTrend":
             return t + "v1/forum/termsdate/histogramagg";
             case"insertCustomKeywords":
             return t + "v1/service/custom/keywords";
             case"forumSearch":
             return t + "v1/forum/title";
             case"forumDetail":
             return t + "v1/forum/reply";
             case"sigmaItWarn":
             return t + "v1/service/sigma/itwarn";
             case"sigmaItWarnMailGet":
             return t + "v1/service/sigma/itwarn/config";
             case"sigmaItWarnMailSet":
             return t + "v1/service/sigma/itwarn/mail";
             case"sigmaItWarnDetail":
             return t + "v1/service/sigma/itwarn/details";
             case"assistantGetQuery":
             return t + "v1/service/opinionmonitor";
             case"assistantAddQuery":
             case"assistantDel":
             case"assistantUpdate":
             return t + "v1/service/opinionmonitor/task";
             case"talkInfo":
             case"talkAdd":
             case"talkDel":
             return t + "v1/service/gas/chatinfo";
             case"talkUpdate":
             return t + "v1/service/gas/chatinfo/analysis";
             case"talkDetailTopic":
             return t + "v1/service/proj/chatinfo/topwords";
             case"talkEmotion":
             return t + "v1/service/proj/chatinfo/attitude";
             case"talkKeywords":
             return t + "v1/service/proj/chatinfo/keywords";
             case"talkTopic":
             return t + "v1/service/proj/chatinfo/topic";
             case"talkUser":
             return t + "v1/service/proj/chatinfo/active";
             case"talkQueryPost":
             return t + "v1/service/gas/chatinfo/posts";
             case"getReportList":
             return t + "v1/service/report/user";
             case"getReportItem":
             return t + "v1/service/report/classify";
             case"faceProfileGlobal":
             return t + "v1/service/profile";
             case"userServiceProject":
             return t + "v1/service/user/project";
             case"userProjectDetail":
             return t + "v1/service/user/project/detail";
             case"innerGame":
             return t + "v1/service/inner/game";
             case"innerOperationBase":
             return t + "v1/service/inner/operation/base";
             case"faceProfileCustomer":
             return t + "v1/service/profile/custom";
             case"innerSearchMeta":
             return t + "v1/service/inner/search/meta";
             case"innerUserDetail":
             return t + "v1/service/inner/property/detail";
             case"innerSearchCsv":
             return t + "v1/service/inner/search/excel";
             case"innerSearch":
             return t + "v1/service/inner/search";
             case"innerLogType":
             return t + "v1/service/inner/gamelog/type";
             case"innerLogMeta":
             return t + "v1/service/inner/gamelog/meta";
             case"innerLogSearch":
             return t + "v1/service/inner/gamelog/search";
             case"innerLogChart":
             return t + "v1/service/inner/gamelog/chart";
             case"innerOperationKpi":
             return t + "v1/service/inner/operation/kpi";
             case"innerRetentionCount":
             return t + "v1/service/inner/operation/retentioncount";
             case"innerPayData":
             return t + "v1/service/inner/operation/paydata";
             case"innerLostAnalysis":
             return t + "v1/service/inner/operation/lostcount";
             case"innerChannelQuality":
             return t + "v1/service/inner/operation/channelquality";
             case"innerLostFunnel":
             return t + "v1/service/inner/operation/lostfunnel";
             case"innerOperationNewUser":
             return t + "v1/service/inner/operation/newuser";
             case"innerOperationActiveUser":
             return t + "v1/service/inner/operation/activeuser";
             case"innerOperationRetentionUser":
             return t + "v1/service/inner/operation/retentionuser";
             case"innerOperationPayUser":
             return t + "v1/service/inner/operation/payuser";
             case"innerOperationLostUser":
             return t + "v1/service/inner/operation/lostuser";
             case"innerOperationHabitUser":
             return t + "v1/service/inner/operation/habituser";
             case"innerOperationPayRateData":
             return t + "v1/service/inner/operation/payratedata";
             case"innerOperationFirstPay":
             return t + "v1/service/inner/operation/firstpay";
             case"innerOperationPayHabit":
             return t + "v1/service/inner/operation/payhabit";
             case"innerOperationChannelPay":
             return t + "v1/service/inner/operation/channelpay";
             case"innerOperationMenu":
             return t + "v1/service/inner/operation/menu";
             case"innerOperationPage":
             return t + "v1/service/inner/operation/page";
             case"demoInnerOperationBase":
             return t + "v1/demo/inner/operation/base";
             case"demoInnerSearchMeta":
             return t + "v1/demo/inner/search/meta";
             case"demoInnerUserDetail":
             return t + "v1/demo/inner/property/detail";
             case"demoInnerSearchCsv":
             return t + "v1/demo/inner/search/excel";
             case"demoInnerSearch":
             return t + "v1/demo/inner/search";
             case"demoInnerLogType":
             return t + "v1/demo/inner/gamelog/type";
             case"demoInnerLogMeta":
             return t + "v1/demo/inner/gamelog/meta";
             case"demoInnerLogSearch":
             return t + "v1/demo/inner/gamelog/search";
             case"demoInnerLogChart":
             return t + "v1/demo/inner/gamelog/chart";
             case"demoInnerOperationKpi":
             return t + "v1/demo/inner/operation/kpi";
             case"demoInnerRetentionCount":
             return t + "v1/demo/inner/operation/retentioncount";
             case"demoInnerPayData":
             return t + "v1/demo/inner/operation/paydata";
             case"demoInnerLostAnalysis":
             return t + "v1/demo/inner/operation/lostcount";
             case"demoInnerChannelQuality":
             return t + "v1/demo/inner/operation/channelquality";
             case"demoInnerLostFunnel":
             return t + "v1/demo/inner/operation/lostfunnel";
             case"demoInnerOperationNewUser":
             return t + "v1/demo/inner/operation/newuser";
             case"demoInnerOperationActiveUser":
             return t + "v1/demo/inner/operation/activeuser";
             case"demoInnerOperationRetentionUser":
             return t + "v1/demo/inner/operation/retentionuser";
             case"demoInnerOperationPayUser":
             return t + "v1/demo/inner/operation/payuser";
             case"demoInnerOperationLostUser":
             return t + "v1/demo/inner/operation/lostuser";
             case"demoInnerOperationHabitUser":
             return t + "v1/demo/inner/operation/habituser";
             case"demoInnerOperationPayRateData":
             return t + "v1/demo/inner/operation/payratedata";
             case"demoInnerOperationFirstPay":
             return t + "v1/demo/inner/operation/firstpay";
             case"demoInnerOperationPayHabit":
             return t + "v1/demo/inner/operation/payhabit";
             case"demoInnerOperationChannelPay":
             return t + "v1/demo/inner/operation/channelpay";
             case"demoInnerOperationMenu":
             return t + "v1/demo/inner/operation/menu";
             case"demoInnerOperationPage":
             return t + "v1/demo/inner/operation/page";
             case"atlasProjectGraphList":
             return t + "v1/project/graph";
             case"opinionRank":
             return t + "v1/service/outer/reputation/opinion/rank";
             case"appstoreRank":
             return t + "v1/service/outer/reputation/appstore/rank";
             case"reputationIntroduceOpinion":
             return t + "v1/service/outer/reputation/introduce/opinion";
             case"reputationIntroduceFeedback":
             return t + "v1/service/outer/reputation/introduce/feedback";
             case"reputationIntroduce":
             return t + "v1/service/outer/reputation/introduce";
             case"reputationFeedbackRank":
             return t + "v1/service/outer/reputation/feedback/rank";
             case"reputationFeedbackKeywords":
             return t + "v1/service/outer/reputation/feedback/keywords";
             case"appstoreClassify":
             return t + "v1/project/appstore/classify";
             case"forumAnalyse":
             return t + "v1/service/outer/reputation/forum/analyse";
             case"forumAnalyseRate":
             return t + "v1/service/outer/reputation/forum/analyse/rate";
             case"forumQualityAnalyse":
             return t + "v1/service/outer/reputation/forum/quality/analyse";
             case"feedbackAnalyse":
             return t + "v1/service/outer/reputation/feedback/analyse";
             case"feedbackAnalyseDetail":
             return t + "v1/service/outer/reputation/feedback/analyse/detail";
             case"feedbackHotwords":
             return t + "v1/service/outer/reputation/feedback/hotwords";
             case"feedbackKeywords":
             return t + "v1/service/outer/reputation/feedback/keywords";
             case"feedbackRank":
             return t + "v1/service/outer/reputation/feedback/rank";
             case"forumAnalyse":
             return t + "v1/service/outer/reputation/forum/analyse";
             case"forumAnalyseRate":
             return t + "v1/service/outer/reputation/forum/analyse/rate";
             case"forumQualityAnalyse":
             return t + "v1/service/outer/reputation/forum/quality/analyse";
             case"forumSearchClassify":
             return t + "v1/service/outer/reputation/forum/search/classify";
             case"channelCount":
             return t + "v1/service/outer/reputation/channel/count";
             case"channelAnalyse":
             return t + "v1/service/outer/reputation/channel/analyse";
             case"reputationSearch":
             return t + "v1/service/outer/reputation/search";
             case"reputationCollect":
             return t + "v1/service/outer/reputation/collection";
             case"reputationHot":
             return t + "v1/service/outer/reputation/hot";
             case"crawlerInfoApps":
             return t + "v1/gas/crawlerinfo/apps";
             case"channelComments":
             return t + "v1/channel/comments";
             case"collect_all":
             return t + "v1/user/project/collection";
             case"collect_set":
             return t + "v1/service/proj/collection?action=collect";
             case"collect_cancel":
             return t + "v1/service/proj/collection?action=uncollect";
             case"operationJoin":
             return t + "v1/activity/operation/join";
             case"appstoreDate":
             return t + "v1/service/outer/reputation/appstore/date";
             case"serviceDownload":
             return t + "v1/service/download";
             case"articleList":
             return t + "v1/article/home";
             case"articleDetail":
             return t + "v1/article/detail";
             case"articleRelation":
             return t + "v1/article/related";
             case"register":
             return t + "v1/login/register";
             case"captcha":
             return t + "v1/geetest/captcha";
             case"sms":
             return t + "v1/login/sms";
             case"qqLogin":
             return t + "v1/login/qq/login";
             case"wxLogin":
             return t + "v1/login/weixin/login";
             case"bindMobile":
             return t + "v1/user/mobile/bind";
             case"checkMobile":
             return t + "v1/user/mobile";
             case"identity":
             return t + "v1/user/identity";
             case"detailMobile":
             return t + "v1/user/details";
             case"resetPass":
             return t + "v1/login/password";
             case"articleClassifyCount":
             return t + "v1/article/classify";
             case"projectReputationSearch":
             return t + "v1/project/reputation/search";
             case"userInfo":
             return t + "v1/user/details";
             case"thirdpartyBind":
             return t + "v1/login/thirdparty/bind";
             case"playerCluster":
             return t + "v1/service/inner/analysis/player/cluster";
             case"playerTag":
             return t + "v1/service/inner/analysis/player/tag";
             case"playerKey":
             return t + "v1/service/inner/analysis/player/key";
             case"clusterType":
             return t + "v1/service/inner/analysis/cluster/type";
             case"playerData":
             return t + "v1/service/inner/analysis/player/data";
             case"playerGroupTag":
             return t + "v1/service/inner/analysis/player/group/tag";
             case"playerGroupSearch":
             return t + "v1/service/inner/analysis/player/search";
             case"searchExcel":
             return t + "v1/service/inner/analysis/search/excel";
             case"operationApply":
             return t + "v1/operation/apply";
             case"playerDistribution":
             return t + "v1/service/inner/analysis/player/distribution";
             case"playerDistributionClassify":
             return t + "v1/service/inner/analysis/player/distribution/classify";
             case"ossChatPolicy":
             return t + "v1/oss/chat_policy";
             case"readReport":
             return t + "v1/service/report";
             case"demoPlayerCluster":
             return t + "v1/demo/inner/analysis/player/cluster";
             case"demoPlayerTag":
             return t + "v1/demo/inner/analysis/player/tag";
             case"demoPlayerKey":
             return t + "v1/demo/inner/analysis/player/key";
             case"demoClusterType":
             return t + "v1/demo/inner/analysis/cluster/type";
             case"demoPlayerData":
             return t + "v1/demo/inner/analysis/player/data";
             case"demoPlayerGroupTag":
             return t + "v1/demo/inner/analysis/player/group/tag";
             case"demoPlayerGroupSearch":
             return t + "v1/demo/inner/analysis/player/search";
             case"demoSearchExcel":
             return t + "v1/demo/inner/analysis/search/excel";
             case"demoPlayerDistribution":
             return t + "v1/demo/inner/analysis/player/distribution";
             case"demoPlayerDistributionClassify":
             return t + "v1/demo/inner/analysis/player/distribution/classify";
             case"countryDetail":
             return t + "v1/home/content";
             case"innerOperationEvaluate":
             return t + "v1/service/inner/operation/evaluate";
             case"demoInnerOperationEvaluate":
             return t + "v1/demo/inner/operation/evaluate";
             case"industryComplainDetail":
             return t + "v1/industry/complain/detail"*/
        }
    }, _ajax: function (e, t, n, a, r, i, o, s) {
        var c = B_Port._init(e);
        console.log("_ajax", e);
        console.log("_ajax o", o);
        console.log("_ajax", {
            timeout: 3e4,
            async: n,
            type: t,
            url: c,
            data: a}
        );

        "get" == t && (a = a ? a + "&nocached=" + (new Date).getTime() : "nocached=" + (new Date).getTime()),
            $.ajax({
            timeout: 3e4,
            async: n,
            type: t,
            url: c,
            data: a,
            beforeSend: function () {
                r && r()
            },
            complete: function () {
            },
            error: function (e, t, n) {
                console.log("加载失败",e)
                i && i(), s && s("", "加载失败，请刷新重试")
            },
            success: function (e) {
                i && i();
                console.log("加载失败成功",e);
                console.log(e.return_message = B_Format._doXss(e.return_message), e.return_code + "")
                try {

                    switch (e.return_message = B_Format._doXss(e.return_message), e.return_code + "") {
                        case"200":
                            "string" == typeof e.data
                            && ("" != e.data ? e.data = $.parseJSON(e.data) : e.data = {}), e.data = B_Format._doXss(e.data), o && o(e.data, e.return_message);
                            break;
                        case"-1001":
                        case"-1016":
                            B_Login._isOpen || (B_Login._isOpen = !0, B_Login._setStatus("out"), B_Login._openLogin("background"));
                            break;
                        case"-1047":
                            B_Login._openBind();
                            break;
                        case"-1004":
                            s && s(e.data, "加载超时，请稍后刷新重试", e.return_code);
                            break;
                        default:
                            console.log("default:")
                            s && s(e.data, e.return_message, e.return_code)
                    }
                } catch (e) {
                    console.log(e), s && s("", "加载失败，请联系管理员")
                }
            }
        })
    }
}, B_Format = {
    _arrowOpenClose: function (e, t, n) {
        $(e).click(function () {
            if ($(t).is(":hidden"))$(t).fadeIn("slow"); else switch (n) {
                case"operateSearch":
                    $(t).fadeOut("slow")
            }
            if (n)switch (n) {
                case"operateSearch":
                    break;
                case"gameSearch":
                    "" == $("#bs_menu_hot_game").html() && M_Game._menuHotGame(0, 8);
                    break;
                case"headMenu":
                    $(".searchItem ").hide(), "" == $(".h_qkList").html() && S_Game._menuHotGame(0, 6);
                    break;
                case"indexSearch":
                    $("#bs_head_search").hide();
                    break;
                default:
                    $("#bs_head_search").hide()
            }
        }), $(e + "," + t).hover(function () {
            $("html").unbind("mousedown")
        }, function () {
            $("html").mousedown(function (e) {
                $(t).fadeOut("quick")
            })
        })
    }, _doXss: function (e) {
        if ("number" == typeof e)return e;
        if ("string" == typeof e)return e.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/&lt;br&gt;/gi, "<br>").replace(/&lt;br\/&gt;/gi, "<br/>");
        if (e instanceof Array) {
            for (var t = 0; t < e.length; ++t)e[t] = B_Format._doXss(e[t]);
            return e
        }
        if (e instanceof Object) {
            for (var n in e)e[n] = B_Format._doXss(e[n]);
            return e
        }
    }, _arrayRemove: function (e, t) {
        var n = $.inArray(t, e);
        return e.slice(0, n).concat(e.slice(n + 1, e.length))
    }, _blankRemove: function (e) {
        return e.replace(/\s+/g, "")
    }, _htmlSpecialChars_encode: function (e) {
        return e.replace(/[<>&"]/g, function (e) {
            return {"<": "&lt;", ">": "&gt;", "&": "&amp;", '"': "&quot;"}[e]
        })
    }, _htmlSpecialChars_decode: function (e) {
        e = e.replace(/(\\r|\\n|\\t)/g, ""), e = e.replace(/\\/g, "");
        var t = {lt: "<", gt: ">", nbsp: " ", amp: "&", quot: '"'};
        return e.replace(/&(lt|gt|nbsp|amp|quot);/gi, function (e, n) {
            return t[n]
        })
    }, _checkLength: function (e, t, n) {
        var a = t;
        e.value.length > a && (e.value = e.value.substring(0, a));
        var r = a - e.value.length;
        $("#" + n).html(r.toString())
    }
}, B_Common = {
    _submitBind: function (e, t) {
        t && t.keyup(function (t) {
            var n = t.keyCode ? t.keyCode : t.which;
            "13" == n && e.click()
        })
    }, _arrayRemove: function (e, t) {
        var n = $.inArray(t, e);
        return e.slice(0, n).concat(e.slice(n + 1, e.length))
    }, _qqUrl: function () {
        return "http://b.qq.com/webc.htm?new=0&sid=800182808&eid=2188z8p8p8q8z8K8z8p8z&q=7"
    }, _decodeUrl: function (e) {
        return e = e.replace(/\+/g, "%20"), decodeURIComponent(e)
    }, _encodeUrl: function (e) {
        return encodeURIComponent(e)
    }, _postData: function (e) {
        var t = [];
        return e && !B_Common._checkObjectIsEmpty(e) && $.each(e, function (e, n) {
            t.push(e + "=" + B_Common._encodeUrl(n))
        }), t = t && t.length > 0 ? t.join("&") : ""
    }, _cdnImgUrl: function () {
        return "http://image.thinkinggame.cn/img/"
    }, _lastUrl: function () {
        return document.referrer
    }, _isMail: function (e) {
        return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(e)
    }, _isMobile: function (e) {
        return /^1\d{10}$/.test(e)
    }, _isInner: function () {
        return parent.window.location.href != window.location.href
    }, _parentUrl: function () {
        return parent.window.location.href
    }, _baseHost: function () {
        return window.location.host.indexOf("127.0.0.1") >= 0 || window.location.host.indexOf("192.") >= 0 ? "http://" + window.location.host + "/" : "http://" + window.location.host + "/"
    }, _browser: function () {
        var e, t = navigator.userAgent, n = t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
        return /trident/i.test(n[1]) ? (e = /\brv[ :]+(\d+)/g.exec(t) || [], {
            name: "IE",
            version: e[1] || ""
        }) : "Chrome" === n[1] && (e = t.match(/\bOPR\/(\d+)/), null != e) ? {
            name: "Opera",
            version: e[1]
        } : (n = n[2] ? [n[1], n[2]] : [navigator.appName, navigator.appVersion, "-?"], null != (e = t.match(/version\/(\d+)/i)) && n.splice(1, 1, e[1]), {
            name: n[0],
            version: n[1]
        })
    }, _replaceLeft: function (e) {
        return e.replace(/\\/g, "")
    }, _focusKeywords: function (e, t) {
        if (t && "" != e) {
            var n = new RegExp("(" + e + ")", "gi");
            return t.replace(n, '<b class="b_colorR">$1</b>')
        }
        return t
    }, _imgDecode: function (e) {
        return e ? (e = decodeURIComponent(e), B_Common._replaceLeft(e)) : ""
    }, _imgBuff: function (e) {
        for (var t = 0; t < e.length; t++)try {
            $('<iframe style="display: none" id="img_' + t + "\" frameborder=no border=0 src=\"javascript:'<!doctype html><html><head><style>*{margin:0;padding:0}</style></head><body><div></div><img src=\\'" + decodeURIComponent(e[t]) + "\\' /></body></html>'\"></iframe>").appendTo("body")
        } catch (e) {
        }
    }, _checkObjectIsEmpty: function (e) {
        return "{}" == JSON.stringify(e)
    }, _submitBind: function (e, t) {
        console.log("绑定事件", e, t)
        t && t.keyup(function (t) {
            var n = t.keyCode ? t.keyCode : t.which;
            "13" == n && e.click()
        })
    }, _btnTextStatus: function (e, t, n) {
        switch (e) {
            case"disable":
                t.text(n.disable).attr("disabled", !0);
                break;
            case"normal":
                t.text(n.normal).attr("disabled", !1)
        }
    }, _getUrl: function (e) {
        var t = window.document.location.href.toString(), n = t.split("?"), a = n[0], r = n[1];
        switch (e) {
            case"hash":
                return a = a.split("#"), a[1] ? (a[1] = a[1].substr(1, a[1].length - 1), a[1] = a[1].replace("/", "|"), a[1]) : "";
            case"query":
                console.log("r is:",r);
                if ("string" == typeof r) {
                    r = r.split("#"), r = r[0], n = r.split("&");
                    var i = {};
                    for (var o in n) {
                        var s = n[o].split("=");
                        i[s[0]] = s[1]
                    }
                    return i
                }
                return {};
            case"controller":
                a = a.toLowerCase(), n = a.split("#"), a = n[0], n = a.split("/");
                var c = n.pop();
                return c = c.replace(".html", "")
        }
    }, _getRadioVal: function (e) {
        var t = "";
        return $("input:radio[name='" + e + "']").each(function () {
            1 == $(this).prop("checked") && (t = $(this).val())
        }), t
    }, _getCheckboxVal: function (e) {
        var t = [];
        return $("input:checkbox[name='" + e + "']").each(function () {
            1 == $(this).prop("checked") && t.push($(this).val())
        }), t.length > 0 ? t.join(",") : ""
    }, _visitFromMobile: function () {
        var e = B_Cookie._get("MobileVisitPc");
        if (!e) {
            var t = navigator.platform, n = new Array("iPhone", "iPod", "iPad", "android", "Nokia", "SymbianOS", "Symbian", "Windows Phone", "Phone", "MAUI", "UNTRUSTED/1.0", "Windows CE", "BlackBerry", "IEMobile"), a = !1;
            (window.location.href.toLowerCase().indexOf("register") > -1 || window.location.href.toLowerCase().indexOf("login") > -1) && (a = !0);
            for (var r = 0; r < n.length; r++)if (!a && t.match(n[r])) {
                var i = B_Common._baseHost();
                return window.location.href = i + "Mobile", !1
            }
        }
    }, _visitCount: function () {
        if (window.location.host.toLowerCase().indexOf("thinkinggame.cn") >= 0) {
            var e = document.createElement("script");
            e.type = "text/javascript", e.async = !0, e.charset = "utf-8", e.src = "https://w.cnzz.com/c.php?id=1259271417&async=1";
            var t = document.getElementsByTagName("script")[0];
            t.parentNode.insertBefore(e, t);
            !function () {
                var e = document.createElement("script");
                e.src = "//hm.baidu.com/hm.js?807f1c5d79f269ff4780a3018e230b2e";
                var t = document.getElementsByTagName("script")[0];
                t.parentNode.insertBefore(e, t)
            }()
        }
    }, _htmlUnicodeTagScriptEscape: function (e) {
        return e = e.replace(/script.*?\/script/g, ""), e = e.replace(/'/g, '"')
    }, _htmlspecialchars_decode: function (e) {
        e = e.replace(/(\\r|\\n|\\t)/g, ""), e = e.replace(/\\/g, "");
        var t = {lt: "<", gt: ">", nbsp: " ", amp: "&", quot: '"'};
        return e.replace(/&(lt|gt|nbsp|amp|quot);/gi, function (e, n) {
            return t[n]
        })
    }, _htmlTagScriptEscape: function (e) {
        return e = e.replace(/<script[^>]*?>.*?<\\?\/script>/g, "")
    }
}, B_Jump = {
    _top: function () {
        $("body,html").animate({scrollTop: 0}, 500)
    }, _go: function (e, t) {
        switch (e) {
            case"hash":
                location.hash = "#" + t;
                break;
            case"open":
                window.open(this._getUrl(t));
                break;
            case"openUrl":
                window.open(t);
                break;
            case"reload":
                top.window.location.reload();
                break;
            case"target":
                top.window.location.href = this._getUrl(t);
                break;
            default:
                top.window.location.href = t
        }
        return !1
    }, _getUrl: function (e, t) {
        return e;
       /* switch (e) {
            case"demo":
                return e + ".html#/" + t.demo;
            case"datacenter":
            case"bind":
            case"information":
            case"refresh":
            case"detail":
            case"operation":
            case"analysis":
            case"radar":
            case"sigma":
            case"product":
            case"price":
            case"company":
            case"join":
            case"partner":
            case"index":
            case"search":
            case"login":
            case"find":
            case"user":
            case"light":
            case"article":
            case"insidepay":
            case"item":
            case"guide":
            case"service":
            case"atlas":
            case"main":
            case"datasolution":
            case"analysissolution":
            case"popluarsolution":
            case"professional":
                return e + ".html";
            case"reg":
                return "register.html";
            case"notices":
                return "notice_s.html";
            case"reportDetail":
                return "reports_s.html";
            case"outsideAlarm":
            case"outsideHotWord":
            case"outsideAssistant":
            case"outsideChat":
            case"outsideCompare":
            case"outsideFaceSummary":
            case"outsideFaceDetail":
            case"outsideFaceCompare":
            case"outsideRankApp":
            case"outsideTask":
                if (!t)return "outside.html#/" + e;
                if (t.id)return "outside.html?g=" + t.id + "#/" + e;
                if (t.nofresh)return "outside.html?nofresh=" + t.nofresh + "#/" + e;
                break;
            case"outsideRankSentiment":
            case"outsideCenter":
            case"outsideAtlas":
            case"outsideChatResult":
                var n = "outside.html";
                if ("undefined" != typeof M_Init)switch (M_Init._controller) {
                    case"demo":
                        n = "demo.html"
                }
                return t ? t.id ? n + "?g=" + t.id + "#/" + e + "/" : t.nofresh ? n + "?nofresh=" + t.nofresh + "#/" + e + "/" : n + "#/" + e + "/" + t.gameId : n + "#/" + e + "/";
            case"reportsGeneral":
            case"reportsItemLost":
            case"reportsItemPay":
            case"reportsItemRationality":
            case"reportsItemHot":
            case"reportsItemDeep":
            case"reportsItemRival":
            case"reportsItemGuide":
            case"reportsItemClustering":
            case"reportsItemIp":
                return "reports.html#/" + e;
            case"insideRetentioncount":
            case"insidePayOsmosis":
            case"insidePayData":
            case"insideLostAnalysis":
            case"insideLostFunnel":
            case"insideChannelQuality":
            case"insideSummary":
            case"insideKeypoint":
            case"insideAdditional":
            case"insideActivity":
            case"insideSave":
            case"insidePay":
            case"insideLost":
            case"insideHabit":
            case"insideAttribute":
            case"insideLog":
            case"insidePayConversion":
            case"insidePayHabit":
            case"insideChannelEarn":
            case"insidePersonality":
            case"insideDemo":
            case"insideAttribute":
            case"insideLog":
            case"operatePlayer":
            case"operateLog":
            case"operateHelper":
            case"operateBasic":
            case"operatePay":
            case"operateLost":
            case"operateDemo":
                var n = "inside.html";
                switch (e) {
                    case"operatePlayer":
                    case"operateLog":
                    case"operateHelper":
                    case"operateBasic":
                    case"operatePay":
                    case"operateLost":
                    case"operateDemo":
                        n = "operate.html"
                }
                if ("undefined" != typeof M_Init)switch (M_Init._controller) {
                    case"demo":
                        n = "demo.html"
                }
                if (t)return "undefined" != typeof t.id ? n + "?g=" + t.id + "#/" + e : n + "#/" + e + "/" + t.type;
                switch (e) {
                    case"operatePlayer":
                    case"operateBasic":
                        return n + "#/" + e + "/";
                    default:
                        return n + "#/" + e
                }
                break;
            case"gameLight":
            case"gameSummary":
            case"gameSentiment":
            case"gameForum":
            case"gameChannel":
            case"gamePost":
            case"gameComment":
            case"gameFaceSummary":
            case"gameFaceDetail":
            case"gameFaceCompare":
            case"gameAnalysis":
            case"gameAssistant":
                return t ? t.id ? "outside.html?g=" + t.id + "#/" + e + "/" : "outside.html#/" + e + "/" + t.gameId : "outside.html#/" + e + "/";
            case"member":
                return "member.html#/" + e
        }*/
    }
}, B_Date = {
    _init: function () {
        return Date.prototype.format = function (e) {
            var t = {
                "M+": this.getMonth() + 1,
                "d+": this.getDate(),
                "h+": this.getHours(),
                "m+": this.getMinutes(),
                "s+": this.getSeconds(),
                "q+": Math.floor((this.getMonth() + 3) / 3),
                S: this.getMilliseconds()
            };
            /(y+)/.test(e) && (e = e.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)));
            for (var n in t)new RegExp("(" + n + ")").test(e) && (e = e.replace(RegExp.$1, 1 == RegExp.$1.length ? t[n] : ("00" + t[n]).substr(("" + t[n]).length)));
            return e
        }, ""
    }(), _strToTime: function (e) {
        var t = e;
        t = t.replace(/-/g, "/");
        var n = new Date(t);
        return n
    }, _getDiffUnixTime: function (e, t) {
        return e = e ? B_Date._strToTime(e) : new Date, Math.round(e.getTime() / 1e3) + 86400 * t
    }, _getDiffDate: function (e, t) {
            console.log("获取时间e：",e);
            console.log("获取时间t：",t);

        e = e ? e + "" === e ? B_Date._strToTime(e) : e : new Date;


        var n = e;
        console.log("时间 e:", n.setDate(e.getDate() + t), n.format("yyyy-MM-dd"))
        return n.setDate(e.getDate() + t), n.format("yyyy-MM-dd")
    }, _getCurrentTime: function () {
        return (new Date).getTime()
    }, _dateFormat: function (e, t) {
        if (t) {
            var n = "yyyy-MM-dd";
            switch (e) {
                case"short":
                    n = "yyyy/MM/dd";
                    break;
                case"mini":
                    n = "yyyy/MM/dd HH:mm"
            }
            switch (typeof t) {
                case"string":
                    t = new Date(t.replace(/-/g, "/"));
                    break;
                case"number":
                    t = new Date(t)
            }
            if (!t instanceof Date)return "";
            var a = {
                yyyy: t.getFullYear(),
                M: t.getMonth() + 1,
                d: t.getDate(),
                H: t.getHours(),
                m: t.getMinutes(),
                s: t.getSeconds(),
                MM: ("" + (t.getMonth() + 101)).substr(1),
                dd: ("" + (t.getDate() + 100)).substr(1),
                HH: ("" + (t.getHours() + 100)).substr(1),
                mm: ("" + (t.getMinutes() + 100)).substr(1),
                ss: ("" + (t.getSeconds() + 100)).substr(1)
            };
            return n.replace(/(yyyy|MM?|dd?|HH?|ss?|mm?)/g, function () {
                return a[arguments[0]]
            })
        }
        return ""
    }, _dateChart: function (e) {
        var e = new Date(e), t = e.getMonth() + 1 < 10 ? "0" + (e.getMonth() + 1) : e.getMonth() + 1, n = e.getDate() < 10 ? "0" + e.getDate() : e.getDate(), a = [t, n];
        return a.join("/")
    }, _hourChart: function (e) {
        var e = this._strToTime(e), t = e.getHours() < 10 ? "0" + e.getHours() : e.getHours(), n = e.getMinutes() < 10 ? "0" + e.getMinutes() : e.getMinutes(), a = [t, n];
        return a.join(":")
    }, _dateArray: function (e, t) {
        e = this._strToTime(e), t = this._strToTime(t);
        for (var n = [], a = e; a.getTime() <= t.getTime(); a.setDate(a.getDate() + 1))n.push({
            small: a.format("MM/dd"),
            big: a.format("yyyy-MM-dd")
        });
        return n
    }, _chooseSingle: function (e, t, n, a, r) {
        console.log("shij");
        new pickerDateRange("dc" + t, {
            autoCommit: e.autoCommit,
            isTodayValid: e.todayValid,
            minValidDate: e.minValidDate,
            startDate: n,
            endDate: a,
            isSingleDay: !0,
            success: function (e, t, n) {
                return function (n) {
                    e.val(n.startDate), t.val(n.endDate), r && r(n.startDate, n.endDate)
                }
            }($("#db" + t), $("#de" + t), $("#dc" + t))
        })
    }, _chooseSection: function (e, t, n, a, r) {
            console.log("初始化时间e",e);
            console.log("初始化时间t",t);
            console.log("初始化时间n",n);
            console.log("初始化时间a",a);
            console.log("初始化时间r",r);
        new pickerDateRange("dc" + t, {
            autoCommit: e.autoCommit,
            isTodayValid: e.todayValid,
            minValidDate: e.minValidDate,
            startDate: n,
            endDate: a,
            theme: "ta",
            defaultText: " 至 ",
            success: function (e, t, n) {
                console.log("n is",n)
                return function (n) {
                    //console.log("n is",n)
                    e.val(n.startDate), t.val(n.endDate), r && r(n.startDate, n.endDate)
                }
            }
            ($("#db" + t), $("#de" + t), $("#dc" + t))
        })
    }
}, B_Tab = {
    _maskShow: function (e, t, n, a) {
        e.each(function (e) {
            $(this).hover(function () {
                "" != t && t.eq(e).addClass(n), a.eq(e).show()
            }, function () {
                "" != t && t.eq(e).removeClass(n), a.eq(e).hide()
            })
        })
    }, _choose: function (e, t, n, a, r, i, o, s, c) {
        switch (i) {
            case"index":
                e.each(function (e) {
                    $(this).click(function () {
                        "undefined" != typeof r && $(this).addClass(r).siblings().removeClass(r), s.eq(e).show().siblings(".p_qkArea").hide(), t.animate({left: e * n + a + "px"}, function () {
                        })
                    })
                });
                break;
            case"vertical":
                e.each(function (e) {
                    $(this).click(function () {
                        "undefined" != typeof r && $(this).addClass(r).siblings().removeClass(r), t.animate({top: e * n + a + "px"}, function () {
                        })
                    })
                });
                break;
            default:
                e.each(function (e) {
                    $(this).click(function () {
                        "undefined" != typeof r && $(this).addClass(r).siblings().removeClass(r), "undefined" != typeof s && s && s.each(function (t) {
                            t == e ? s.eq(t).show() : s.eq(t).hide()
                        }), "undefined" != typeof c && c && c.each(function (t) {
                            t == e ? c.eq(t).show() : c.eq(t).hide()
                        }), "undefined" != typeof t && t && t.animate({left: e * n + a + "px"}, function () {
                        })
                    })
                })
        }
    }
}, B_Chart = {
    _chartBarn: [], _getEChart: function (e, t, n, a) {
        var r = {
            color: n.color ? n.color : ["#AEDD8C", "#72C4FF", "#FFA6A5", "#BFA4F1", "#FFDE5D", "#EE9ABC", "#4ECDC4", "#73D7F7", "#FDB96A", "#F9FF91", "#FF9900"],
            title: n.title ? n.title : "",
            tooltip: {
                formatter: n.tooltip.formatter ? n.tooltip.formatter : "",
                trigger: n.tooltip.trigger,
                backgroundColor: "#ffffff",
                borderColor: "#E5E5E5",
                borderWidth: 1,
                padding: 5,
                textStyle: {color: "#A9A9A9", fontSize: "11px"},
                axisPointer: {
                    type: n.tooltip.axisPointerType ? n.tooltip.axisPointerType : "line",
                    lineStyle: {color: "#DBDBDB"}
                }
            },
            visualMap: n.visualMap ? n.visualMap : "",
            dataZoom: n.dataZoom ? n.dataZoom : "",
            radar: n.radar ? n.radar : "",
            legend: n.legend,
            grid: n.grid,
            xAxis: n.xAxis,
            yAxis: n.yAxis,
            series: n.series
        }, i = echarts.init(document.getElementById(t));
        switch (B_Chart._chartBarn.push([t, i]), e) {
            case"lineActive":
                var o = 29;
                setInterval(function () {
                    o = o > F_Industry_Common._cache.allData.length ? 0 : o + 1, n.series[0].data.shift(), n.xAxis[0].data.shift(), n.series[0].data.push(F_Industry_Common._cache.allData[o]), n.xAxis[0].data.push(F_Industry_Common._cache.allDate[o]), i.setOption({
                        xAxis: [{data: n.xAxis[0].data}],
                        series: [{data: n.series[0].data}]
                    })
                }, 2e3);
            default:
                i.setOption(r)
        }
        switch (B_Storage._get("CLIENT_WIDTH") || B_Storage._set("CLIENT_WIDTH", document.body.clientWidth), window.addEventListener("resize", function () {
            var e = document.body.clientWidth, t = B_Storage._get("CLIENT_WIDTH");
            if (e != t) {
                for (var n = 0; n < B_Chart._chartBarn.length; n++)B_Chart._chartBarn[n][1].resize();
                B_Storage._set("CLIENT_WIDTH", e)
            }
        }), a) {
            case"gameForumTotalLight":
                i.on("click", function (e) {
                    0 == e.value ? B_Pop._init("msg", {content: "当前日期无数据，请选择其他日期"}) : e.name && F_GameLight_Info._chartClick(a, {
                        date: e.name,
                        type: e.seriesName
                    })
                });
                break;
            case"gameChannelCountLight":
                i.on("click", function (e) {
                    0 == e.value ? B_Pop._init("msg", {content: "当前日期无数据，请选择其他日期"}) : e.name && F_GameAnalysis_Info._chartClick(a, {
                        date: e.name,
                        type: e.seriesName
                    })
                });
                break;
            case"appStoreRank":
                i.on("click", function (e) {
                    F_Industry_AppStore._more(e.name)
                });
                break;
            case"gameForumTotal":
            case"gameEmotionRank":
                i.on("click", function (e) {
                    0 == e.value ? B_Pop._init("msg", {content: "当前日期无数据，请选择其他日期"}) : e.name && F_GameForum_Info._chartClick(a, {
                        date: e.name,
                        type: e.seriesName
                    })
                });
                break;
            case"gameChannelCount":
                i.on("click", function (e) {
                    0 == e.value ? B_Pop._init("msg", {content: "当前日期无数据，请选择其他日期"}) : e.name && F_GameChannel_Info._chartClick(a, {name: e.name})
                });
            case"gameAssistantAlarm":
                i.on("click", function (e) {
                    0 == e.value ? B_Pop._init("msg", {content: "当前时间段该类问题舆情正常，无需警戒"}) : e.name && F_GameAssistant_Info._chartClick("bs_suddenly_chart", {
                        date: e.name,
                        classify: e.seriesName
                    })
                });
                break;
            default:
                switch (t) {
                    case"bs_suddenly_chart":
                        i.on("click", function (e) {
                            0 == e.value ? B_Pop._init("msg", {content: "当前时间段该类问题舆情正常，无需警戒"}) : e.name && F_Alarm_Info._getFromChartClick(e.name, e.seriesName)
                        });
                        break;
                    case"bs_hotwrod_tread":
                        i.on("click", function (e) {
                            0 == e.value ? B_Pop._init("msg", {content: "当前日期无数据，请选择其他日期"}) : e.name && F_Hot_Info._getFromChartClick(e.name, e.seriesName)
                        });
                        break;
                    case"bs_chatresult_topic":
                        i.on("click", function (e) {
                            e.name && F_ChatResult_Topic._formatTopic(e.name)
                        });
                        break;
                    case"bs_chatresult_keywords":
                        i.on("click", function (e) {
                            e.name && F_ChatResult_Common._openDetail("detail", {word: e.name})
                        });
                        break;
                    case"bs_emotion":
                        i.on("click", function (e) {
                            0 == e.value ? B_Pop._init("msg", {content: "当前日期无数据，请选择其他日期"}) : F_GameSummary_Info._chartClick("bs_emotion", {
                                date: e.name,
                                type: e.seriesName
                            })
                        });
                        break;
                    case"bs_word_tendency":
                        i.on("click", function (e) {
                            0 == e.value ? B_Pop._init("msg", {content: "当前日期无数据，请选择其他日期"}) : F_GameSentiment_Info._chartClick("bs_word_tendency", {date: e.name})
                        });
                        break;
                    case"bs_word_distribute":
                        i.on("click", function (e) {
                            0 == e.value ? B_Pop._init("msg", {content: "当前日期无数据，请选择其他日期"}) : F_GameSentiment_Info._chartClick("bs_word_distribute", {type: e.name})
                        });
                        break;
                    case"bs_rank_detail_chart":
                        i.on("click", function (e) {
                            0 == e.value ? B_Pop._init("msg", {content: "当前日期无数据，请选择其他日期"}) : F_GameSentiment_Info._chartClick("bs_rank_detail_chart", {date: e.name})
                        });
                        break;
                    case"bs_emotion_light":
                        i.on("click", function (e) {
                            0 == e.value ? B_Pop._init("msg", {content: "当前日期无数据，请选择其他日期"}) : F_GameLight_Info._chartClick("bs_emotion_light", {
                                date: e.name,
                                type: e.seriesName
                            })
                        });
                        break;
                    case"bs_word_tendency_light":
                        i.on("click", function (e) {
                            0 == e.value ? B_Pop._init("msg", {content: "当前日期无数据，请选择其他日期"}) : F_GameLight_Info._chartClick("bs_word_tendency_light", {date: e.name})
                        });
                        break;
                    case"bs_rank_detail_chart_light":
                        i.on("click", function (e) {
                            0 == e.value ? B_Pop._init("msg", {content: "当前日期无数据，请选择其他日期"}) : F_GameLight_Info._chartClick("bs_rank_detail_chart_light", {date: e.name})
                        });
                        break;
                    case"bs_hotword_tread_light":
                        i.on("click", function (e) {
                            0 == e.value ? B_Pop._init("msg", {content: "当前日期无数据，请选择其他日期"}) : e.name && F_GameAssistant_Info._chartClick("bs_hotword_tread_light", {
                                date: e.name,
                                name: e.seriesName
                            })
                        })
                }
        }
    }
}, B_Page = {
    _size: 10, _currentPage: 1, _number: 2, _init: function (e) {
        var t = {pageSize: 10, pageCount: 0, total: e.total, dom: e.dom};
        return t.pageSize = e.pageSize ? e.pageSize : B_Page._size, e.total && e.total > 0 && (t.pageCount = Math.ceil(e.total / t.pageSize), t.pageCount > 1e3 && (t.pageCount = 1e3)), e.page = e.page ? e.page : 1, t.page = e.page > t.pageCount ? t.pageCount : e.page, t
    }, _show: function (e, t) {
        var n = B_Page._init(e);
        return B_Page._format(n, t)
    }, _format: function (e, t) {
        var n = "";
        if (e.pageCount > 1)switch (t) {
            case"simple":
            case"number":
                n += '<ul class="fl">', "number" == t && (n += "<li>每页显示<b>" + e.pageSize + "</b>条记录</li>"), n += "<li>(共<b>" + e.total + "</b>条记录)</li></ul>", n += '<ul class="fr">', n += '<li>第<input type="text" value="' + e.page + '">页</li>', n += '<li><button class="jump-page tg-assist-btn" data-d="' + e.dom + '" data-a="' + e.pageCount + '">确定</button></li>', n += "<li>", n += e.page <= 1 ? '<button  data-d="' + e.dom + '" class="prev-page tg-assist-btn turn" disabled>&lt;</button>' : '<button  data-d="' + e.dom + '" class="prev-page tg-assist-btn turn">&lt;</button>', n += "</li>", n += "<li>", n += e.page >= e.pageCount ? '<button  data-d="' + e.dom + '" class="next-page tg-assist-btn turn" disabled>&gt;</button>' : '<button  data-d="' + e.dom + '" class="next-page tg-assist-btn turn">&gt;</button>', n += "</li>";
                break;
            case"page":
                var a = "", r = "";
                n += "<li>", a += '<span class="prev"><button', e.page <= 1 && (a += " disabled"), a += ">上一页</button></span>", e.pageCount > 5 && e.page > 3 && (a += '<span class="page-num">1</span><span class="page-num">…</span>'), e.pageCount > 5 && e.pageCount - e.page > 3 && (r += '<span class="page-num">…</span><span class="page-num">' + e.pageCount + "</span>"), r += '<span class="next"><button', e.page >= e.pageCount && (r += " disabled"), r += ">下一页</button></span>", e.page = parseInt(e.page);
                var i = e.page - parseInt(B_Page._number), o = e.page + parseInt(B_Page._number);
                i < 1 && (o += 1 - i, i = 1), o > e.pageCount && (i -= o - e.pageCount, o = e.pageCount), i < 1 && (i = 1), n += a;
                for (var s = i; s <= o; s++)n += s == e.page ? '<span class="page-num num-selected">' + s + "</span>" : '<span class="page-num">' + s + "</span>";
                n += r, n += '</li><li class="page-num-total">共 <b>' + e.pageCount + "</b> 页 <b>" + e.total + "</b>个 结果</li>"
        }
        return n
    }, _click: function (e, t, n) {
        switch (n) {
            case"bs_search_game_page":
            case"bs_search_article_page":
                var a = $("#" + n);
                a.find("span").each(function () {
                    var n = !1;
                    $(this).click(function () {
                        $(this).hasClass("prev") ? (n = !0, e = parseInt(e) - 1) : $(this).hasClass("next") ? (n = !0, e = parseInt(e) + 1) : $(this).hasClass("page-num") && "…" != $(this).html() && e != $(this).html() && (n = !0, e = $(this).html()), n && (t(e), B_Jump._top())
                    })
                });
                break;
            default:
                var a = n ? "bs_page_" + n : "lt_forum_page";
                $("#" + a + " .prev-page").click(function () {
                    t && t(parseInt(e) - 1, $(this).attr("data-d"))
                }), $("#" + a + " .next-page").click(function () {
                    t && t(parseInt(e) + 1, $(this).attr("data-d"))
                }), $("#" + a + " .jump-page").click(function () {
                    var n = $.trim($("#" + a + " input").val()), r = $(this).attr("data-a");
                    return "" == n || isNaN(n) ? (B_Pop._init("msg", {content: "页码必须为数字,请确认！"}), !1) : parseInt(n) <= 0 ? (B_Pop._init("msg", {content: "页码错误,请确认！"}), !1) : parseInt(n) != parseInt(e) && (parseInt(r) < parseInt(n) ? (B_Pop._init("msg", {content: "页码错误,请确认！"}), !1) : void(t && t(n, $(this).attr("data-d"))))
                }), B_Common._submitBind($("#" + a + " .jump-page"), $("#" + a + " input"))
        }
    }
}, B_AD = {
    _adImg: function () {
        return "/img/post/"
    }, _ad: function (e, t) {
        var n = B_AD._adImg();
        switch (e) {
            case"ad_1":
                n += "report.jpg", $("#ad_1").html('<a href="http://file.thinkinggame.cn/pdf/report/2016%E5%B9%B4%E4%B8%8B%E5%8D%8A%E5%B9%B4%E6%B8%B8%E6%88%8F%E8%A1%8C%E4%B8%9A%E8%88%86%E6%83%85%E6%8A%A5%E5%91%8A.pdf" target="_blank"><img src="' + n + '"></a>');
                break;
            case"ad_2":
                n += "activity.jpg", $("#ad_2").html('<img src="' + n + '" onclick="B_Login._openApplication()">');
                break;
            case"ad_3":
                n += "post-a.png", $(".lg_right").html('<img src="' + n + "\" onclick=\"B_Jump._go('base','" + t + "')\">")
        }
    }
};